﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace _2_4
{
    public partial class Form1 : Form

    {
        public Form1()
        {
            InitializeComponent();
            
            textBox4.ReadOnly = true;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
              
                double num1 = Convert.ToDouble(textBox1.Text);
                double num2 = Convert.ToDouble(textBox2.Text);
                double num3 = Convert.ToDouble(textBox3.Text);

                double temp;
                
                if (num1 < num2)
                {
                    temp = num1;
                    num1 = num2;
                    num2 = temp;
                }
                if (num1 < num3)
                {
                    temp = num1;
                    num1 = num3;
                    num3 = temp;
                }
                if (num2 < num3)
                {
                    temp = num2;
                    num2 = num3;
                    num3 = temp;
                }
               
                textBox4.Text = $"{num1} > {num2} > {num3}";
            }
            catch (FormatException)
            {
                
                MessageBox.Show("请输入有效的数字！");
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
              
                double num1 = Convert.ToDouble(textBox1.Text);
                double num2 = Convert.ToDouble(textBox2.Text);
                double num3 = Convert.ToDouble(textBox3.Text);

                double temp;
               
                if (num1 > num2)
                {
                    temp = num1;
                    num1 = num2;
                    num2 = temp;
                }
                if (num1 > num3)
                {
                    temp = num1;
                    num1 = num3;
                    num3 = temp;
                }
                if (num2 > num3)
                {
                    temp = num2;
                    num2 = num3;
                    num3 = temp;
                }
              
                textBox4.Text = $"{num1} < {num2} < {num3}";
            }
            catch (FormatException)
            {
              
                MessageBox.Show("请输入有效的数字！");
            }
        }
    }
}